
package nccloud.arap.amortization.aggamortizationvo.util.bp;

import java.util.HashSet;
import java.util.Set;

import nc.bs.bd.cache.CacheProxy;
import nc.impl.pubapp.pattern.data.bill.BillDelete;
import nc.impl.pubapp.pattern.data.bill.tool.BillTransferTool;
import  nc.vo.arap.amortization.AggAmortizationVO;

public class AmortizationVODeleteBP {

    /**
    * 删除
    *
    * @param vos
    */
    public void delete(AggAmortizationVO[] vos) {
        // 加锁 、检查时间戳
        BillTransferTool<AggAmortizationVO> tool = new BillTransferTool<AggAmortizationVO>(vos);

        AggAmortizationVO[] delFullvos = tool.getClientFullInfoBill();

        BillDelete<AggAmortizationVO> bo = new BillDelete<AggAmortizationVO>();
        bo.delete(delFullvos);
        Set<String> pks = new HashSet<String>();
        for (AggAmortizationVO vo : vos) {
            pks.add(vo.getPrimaryKey());
        }
        // 删除之后通知前台缓存
        CacheProxy.fireDataDeletedBatch("pk_amortization", pks.toArray(new String[pks.size()]));
    }
}
